<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <title>Document</title>
</head>
<body>
<form class="layui-form" action="" id="lineForm" style="padding: 10px 15px;" lay-filter="lineForm">
    <input type="hidden" name="id">
    <input type="hidden" name="startPoleCode">
    <input type="hidden" name="endPoleCode">
    <div class="layui-form-item">
        <label class="layui-form-label">线路编号:</label>
        <div class="layui-input-block">
            <input type="text" name="lineCode" required  lay-verify="required" placeholder="请输入线路编号" autocomplete="off" class="layui-input" width="200" id="userName">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">线路名称:</label>
        <div class="layui-input-block">
            <input type="text" name="lineName" required  lay-verify="required" placeholder="请输入线路名称" autocomplete="off" class="layui-input" width="200">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">线路长度:</label>
        <div class="layui-input-block">
            <input type="text" name="lineLength" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" width="350px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">回路长度:</label>
        <div class="layui-input-block">
            <input type="text" name="backLength" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input" width="350px">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">投运日期:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="riqi" placeholder="" name="productDate">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">电压等级:</label>
        <div class="layui-input-block">
            <input type="text" name="voltageLevel" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input" width="300px">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">杆塔:</label>
        <div class="layui-input-block">
            <select name="poleStr" class="layui-select" id="pole" xm-select="poles" width="300px">
                <option value="-1">请选择</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">塔基数:</label>
        <div class="layui-input-block">
            <input type="text" name="towerBaseNum" required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input" width="300px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否启用</label>
        <div class="layui-input-block">
            <input type="checkbox" name="isStart" value="1" lay-skin="switch">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">备注:</label>
        <div class="layui-input-block">
            <textarea name="common" id="" cols="30" rows="10"></textarea>
        </div>
    </div>
</form>
<script>
    layui.form.render();
    var laydate = layui.laydate;
    laydate.render({
        elem: '#riqi'
        ,format: 'yyyy年MM月dd日'
    });

    //显示杆塔
    $.get("${path}/psPole/getPole",function (data) {
        $.each(data,function () {
            var option = $('<option></option>').appendTo("#pole");
            option.text(this.poleCode).val(this.id);
        });
        layui.formSelects.render();
    });

    layui.form.render();
</script>
</body>
</html>